<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
  <div id="div" style="background-color: #0d1721">


    <h1>11111</h1>
  </div>
</body>
<script type="application/javascript">
  var dom = document.getElementById('div');
  if(dom.getBoundingClientRect){
    var body = document.compatMode == 'CSS1Compat'?document.documentElement:document.body;
    var box = dom.getBoundingClientRect();
    console.log({x : box.left + body.scrollLeft, y : box.top + body.scrollTop});
  }else{
    var x = y = 0;
    var p = dom;
    while(p.offsetParent){
      x += p.offsetLeft;
      y += p.offsetTop;
      p = p.offsetParent;
    }
    console.log({x:x, y:y});
  }
</script>
</html>